home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 3 / ct-rom iiib.zip / ct-rom iiib / WINDOWS / DIVERSEN / WINE02BX / SORT.ELC < prev    next >
Text File  |  1993-03-28  |  9KB  |  104 lines

  1. ;;; compiled by @win386 on Sat Mar 13 01:40:21 1993
  2. ;;; from file c:/src/lucid-19.4/lisp/prim/sort.el
  3. ;;; emacs version 19.3 Lucid.
  4. ;;; bytecomp version 2.08; 27-aug-92.
  5. ;;; optimization is on.
  6. ;;; this file uses opcodes which do not exist in Emacs18.
  7.  
  8. (if (and (boundp 'emacs-version)
  9.      (or (and (boundp 'epoch::version) epoch::version)
  10.          (string-lessp emacs-version "19")))
  11.     (error "This file was compiled for Emacs19."))
  12.  
  13. (provide 'sort)
  14. (fset 'sort-subr #[(reverse nextrecfun endrecfun &optional startkeyfun endkeyfun) "è└┴!ê┬ $╚!    ½┌¼àƒ└╩!ê╦╠!½Ü╠ë@@º½â═¬ï@@:½â╬¬ü╧\"¬ÿ╨ë@@º½â╤¬ï@@:½â╥¬ü╙\"½àƒ└╘!ê╒    \"ê*└╓!ê)╫ç" [message "Finding sort keys..." sort-build-lists nextrecfun endrecfun startkeyfun endkeyfun sort-lists reverse old "Sorting records..." fboundp sortcar < buffer-substring-lessp string< sort #[(a b) "@    @Wç" [a b] 2] #[(a b) "└    @\n@\"ç" [buffer-substring-lessp a b] 3] #[(a b) "@    @Öç" [a b] 2] "Reordering buffer..." sort-reorder-buffer "Reordering buffer... Done" nil] 5 "\
  15. General text sorting routine to divide buffer into records and sort them.
  16. Arguments are REVERSE NEXTRECFUN ENDRECFUN &optional STARTKEYFUN ENDKEYFUN.
  17.  
  18. We consider this portion of the buffer to be divided into disjoint pieces
  19. called sort records.  A portion of each sort record (perhaps all of it)
  20. is designated as the sort key.  The records are rearranged in the buffer
  21. in order by their sort keys.  The records may or may not be contiguous.
  22.  
  23. Usually the records are rearranged in order of ascending sort key.
  24. If REVERSE is non-nil, they are rearranged in order of descending sort key.
  25.  
  26. The next four arguments are functions to be called to move point
  27. across a sort record.  They will be called many times from within sort-subr.
  28.  
  29. NEXTRECFUN is called with point at the end of the previous record.
  30. It moves point to the start of the next record.
  31. It should move point to the end of the buffer if there are no more records.
  32. The first record is assumed to start at the position of point when sort-subr
  33. is called.
  34.  
  35. ENDRECFUN is is called with point within the record.
  36. It should move point to the end of the record.
  37.  
  38. STARTKEYFUN may moves from the start of the record to the start of the key.
  39. It may return either return a non-nil value to be used as the key, or
  40. else the key will be the substring between the values of point after
  41. STARTKEYFUNC and ENDKEYFUN are called.
  42.  
  43. ENDKEYFUN moves from the start of the sort key to the end of the sort key.
  44. ENDKEYFUN may be nil if STARTKEYFUN returns a value or if it would be the
  45. same as ENDRECFUN."])
  46. (byte-code "└┴Mê┬├Mç" [sort-build-lists #[(nextrecfun endrecfun startkeyfun endkeyfun) "└ëëëm¼═`└┴┼ì\n└¼ö½å ê¬è½å ê╚    ½£    :½æ    @ ܽ  A`ܽࠠ  ëB¬ä     `E B\n¼:½6 ê¬0 ,ç" [nil key done start-rec sort-lists (byte-code "½ä «ÿ`\n«â ─ ê╞╟!½à    `B¬â    `{)ç" [startkeyfun start endkeyfun endrecfun t done fboundp buffer-substring-lessp] 2) endrecfun nextrecfun t] 4] sort-reorder-buffer #[(sort-lists old) "└eeddbê┼╞!ê\ndS}ê½░dbê╚p     @A@#êdbê╚p@A@╩@8#ê╩    @8A    A    ¬Ldbê╚p     #ê\n    |êdbê\n`T}ê``T|,ç" [t max min last inhibit-quit insert-before-markers " " sort-lists insert-buffer-substring old 2] 5]] 2)
  47. (fset 'sort-lines #[(reverse beg end) "èî    }êebê┬ ─┼#*ç" [beg end sort-subr reverse forward-line end-of-line] 4 "\
  48. Sort lines in region alphabetically; argument means descending order.
  49. Called from a program, there are three arguments:
  50. REVERSE (non-nil means reverse order), BEG and END (region to sort)." "P\nr"])
  51. (fset 'sort-paragraphs #[(reverse beg end) "èî    }êebê┬ ─┼#*ç" [beg end sort-subr reverse #[nil "└┴wç" ["\n      " nil] 2] forward-paragraph] 4 "\
  52. Sort paragraphs in region alphabetically; argument means descending order.
  53. Called from a program, there are three arguments:
  54. REVERSE (non-nil means reverse order), BEG and END (region to sort)." "P\nr"])
  55. (fset 'sort-pages #[(reverse beg end) "èî    }êebê┬ ─┼#*ç" [beg end sort-subr reverse #[nil "└┴wç" ["\n" nil] 2] forward-page] 4 "\
  56. Sort pages in region alphabetically; argument means descending order.
  57. Called from a program, there are three arguments:
  58. REVERSE (non-nil means reverse order), BEG and END (region to sort)." "P\nr"])
  59. (byte-code "└┴!¼é┬    ¼╕├ ─╟W½ì╚╔#êTë¬o╚╩╦#ê╚╠╦#ê╚═╦#ê╚╬╧#ê*┬ç" [boundp sort-fields-syntax-table nil make-syntax-table 0 i table 256 modify-syntax-entry "w" 32 " " 9 10 46 "_"] 5)
  60. (fset 'sort-numeric-fields #[(field beg end) "└    \n ─┼%ç" [sort-fields-1 field beg end #[nil "└    S!ê┬`è├─!ê`){!ç" [sort-skip-fields field string-to-int forward-sexp 1] 4] nil] 6 "\
  61. Sort lines in region numerically by the ARGth field of each line.
  62. Fields are separated by whitespace and numbered from 1 up.
  63. Specified field must contain a number in each line of the region.
  64. With a negative arg, sorts by the -ARG'th field, in decending order.
  65. Called from a program, there are three arguments:
  66. FIELD, BEG and END.  BEG and END specify region to sort." "p\nr"])
  67. (fset 'sort-fields #[(field beg end) "└    \n ─┼%ç" [sort-fields-1 field beg end #[nil "└    S!ê┬ç" [sort-skip-fields field nil] 2] #[nil "└┴wç" ["^     \n" nil] 2]] 6 "\
  68. Sort lines in region lexicographically by the ARGth field of each line.
  69. Fields are separated by whitespace and numbered from 1 up.
  70. With a negative arg, sorts by the -ARG'th field, in decending order.
  71. Called from a program, there are three arguments:
  72. FIELD, BEG and END.  BEG and END specify region to sort." "p\nr"])
  73. (byte-code "└┴Mê┬├Mç" [sort-fields-1 #[(field beg end startkeyfun endkeyfun) "┴W┬ ┼ë[]]╞Äèî}êebê╔\n!ê╦ ╠═%-ç" [field 0 syntax-table tbl reverse 1 ((set-syntax-table tbl)) beg end set-syntax-table sort-fields-syntax-table sort-subr forward-line end-of-line startkeyfun endkeyfun] 6] sort-skip-fields #[(n) "è└ê`)\nvê`    V½î├─è┼yê`)    {\"ê╞╟w)ç" [1 eol n error "Line has too few fields: %s" 0 "     " nil] 4]] 2)
  74. (fset 'sort-regexp-fields #[(reverse record-regexp key-regexp beg end) "┴ܼà┬ܽä├¬î─┼\"½å╞H╟Zèî    }êebê╩ ╠!ê` ├öbê╬╨╤╥$+ç" [key-regexp "" "\\&" 0 string-match "\\`\\\\[1-9]\\'" 1 48 beg end nil sort-regexp-record-end re-search-forward record-regexp sort-subr reverse #[nil "└    ┬├#¡ë─òë¡â─öbç" [re-search-forward record-regexp nil move 0 sort-regexp-record-end] 4] #[nil "bç" [sort-regexp-record-end] 1] #[nil "└\nº½ä\n¬É├\n ┼#½ä└¬à╞╟╚\"ê╚╔╩Å)ç" [0 n key-regexp re-search-forward sort-regexp-record-end t throw key nil (byte-code "└┴!½å\nö\nòBç\nö\nò{ç" [fboundp buffer-substring-lessp n] 2) ((error (byte-code "└┴┬\"ç" [throw key nil] 3)))] 4]] 5 "\
  75. Sort the region lexicographically as specifed by RECORD-REGEXP and KEY.
  76. RECORD-REGEXP specifies the textual units which should be sorted.
  77.   For example, to sort lines RECORD-REGEXP would be \"^.*$\"
  78. KEY specifies the part of each record (ie each match for RECORD-REGEXP)
  79.   is to be used for sorting.
  80.   If it is \"\\digit\" then the digit'th \"\\(...\\)\" match field from
  81.   RECORD-REGEXP is used.
  82.   If it is \"\\&\" then the whole record is used.
  83.   Otherwise, it is a regular-expression for which to search within the record.
  84. If a match for KEY is not found within a record then that record is ignored.
  85.  
  86. With a negative prefix arg sorts in reverse order.
  87.  
  88. For example: to sort lines in the region by the first word on each line
  89.  starting with the letter \"f\",
  90.  RECORD-REGEXP would be \"^.*$\" and KEY would be \"\\=\\<f\\w*\\>\"" "P\nsRegexp specifying records to sort: \nsRegexp specifying key within record: \nr"])
  91. (byte-code "└┴!¼é┬└ç" [boundp sort-columns-subprocess t] 2)
  92. (fset 'sort-columns #[(reverse &optional beg end) "è└ëëëëë^bêi╔yê`]bêi└yê` ^ ]╩╦╠#½ä═╬!ê╨=¼Ü╤╥╠ë└½â╘¬ü╒╓\nP╫    P&    ¬öèî}êbê╪┘┌█▄%*.ç" [nil col-end col-start col-end1 col-beg1 end1 beg1 beg end 0 search-backward "    " t error "sort-columns does not work with tabs.  Use M-x untabify." system-type vax-vms call-process-region "sort" reverse "-rt\n" "-t\n" "+0." "-0." sort-subr forward-line end-of-line #[nil "└    !ê┬ç" [move-to-column col-start nil] 2] #[nil "└    !ê┬ç" [move-to-column col-end nil] 2]] 11 "\
  93. Sort lines in region alphabetically by a certain range of columns.
  94. For the purpose of this command, the region includes
  95. the entire line that point is in and the entire line the mark is in.
  96. The column positions of point and mark bound the range of columns to sort on.
  97. A prefix argument means sort into reverse order.
  98.  
  99. Note that `sort-columns' rejects text that contains tabs,
  100. because tabs could be split across the specified columns
  101. and it doesn't know how to handle that.  Also, when possible,
  102. it uses the `sort' utility program, which doesn't understand tabs.
  103. Use \\[untabify] to convert tabs to spaces before sorting." "P\nr"])
  104.